package zy3;

import java.util.Scanner;

/**
 * 书类
 */
public class Book {
    Scanner input = new Scanner(System.in);

    private String bookName;

    private int totalPages = 200;


    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    public int getTotalPages() {
        return totalPages;
    }

    public void setTotalPages(int totalPages) {
        this.totalPages = totalPages;
    }

    public void details(){
        int paGination;
        System.out.println("请输入书名:");
        this.bookName = input.nextLine();
        System.out.println("请输入书本的页数:");
        paGination = input.nextInt();
        if (paGination > 200){
            System.out.println("错误信息! "+this.totalPages);
        }else {
            System.out.println("书名为:"+bookName+"书本的页数为:"+paGination);
        }
    }

    public static void main(String[] args) {
        Book book = new Book();
        book.details();
    }
}
